package com.ZengQi.event.service.impl;

import com.ZengQi.event.dao.AdminDao;
import com.ZengQi.event.dao.impl.AdminDaoImpl;
import com.ZengQi.event.entity.Admin;
import com.ZengQi.event.service.AdminService;

public class AdminServiceImpl implements AdminService {
    private final AdminDao adminDao=new AdminDaoImpl();
    @Override
    public Admin findAdmin(Admin conditionAdmin) {
        return adminDao.getAdmin(conditionAdmin);
    }

    @Override
    public boolean removeAdmin(Admin conditionAdmin) {
        return adminDao.deleteAdmin(conditionAdmin);
    }

    @Override
    public boolean saveAdmin(Admin admin) {
        return adminDao.insertAdmin(admin);
    }

    @Override
    public boolean modifyAdminByOldCompanyName(Admin admin, String oldCompanyName) {
        return adminDao.updateAdminByOldCompanyName(admin,oldCompanyName);
    }
}
